<template>
  <div id="Address">
    <v-detail
      :detailData="inputData"
      :inputConfig="inputConfig"
      :rules="rules"
      ref="detail"
    ></v-detail>
  </div>
</template>

<script>
import detail from "commons/Detail";
import baseMixin from "@/mixins/BaseMixin";

export default {
  name: "Address",
  mixins: [baseMixin],
  props: {
    inputData: {
      type: Object,
    },
  },
  data() {
    return {
      addflag: false,
      rules: {},
    };
  },
  computed: {
    inputConfig() {
      return [
        [
          {
            type: "input",
            label: this.$t("config.address", { no: "1" }),
            props: "address1",
            disabled: this.addflag,
          },
          {
            type: "input",
            label: this.$t("config.address", { no: "2" }),
            props: "address2",
            disabled: this.addflag,
          },
          {
            type: "input",
            label: this.$t("config.address", { no: "3" }),
            props: "address3",
            disabled: this.addflag,
          },
          {
            type: "input",
            label: this.$t("config.address", { no: "4" }),
            props: "address4",
            disabled: this.addflag,
          },
          {
            type: "input",
            label: this.$t("config.address", { no: "5" }),
            props: "address5",
            disabled: this.addflag,
          },
          {
            type: "input",
            label: this.$t("config.address", { no: "6" }),
            props: "address6",
            disabled: this.addflag,
          },
        ],
        [
          {
            type: "input",
            label: this.$t("bill.country"),
            props: "country",
            disabled: this.addflag,
          },
          {
            type: "select",
            label: this.$t("bill.countryCode"),
            props: "isocntrycode",
            options: this.getOptions("querycodeLkup/ISOCOUNTRY"),
            disabled: this.addflag,
          },
          {
            type: "input",
            label: this.$t("config.city"),
            props: "city",
            disabled: this.addflag,
          },
          {
            type: "input",
            label: this.$t("config.provice"),
            props: "state",
            disabled: this.addflag,
          },
          {
            type: "input",
            label: this.$t("config.postcode"),
            props: "zip",
            disabled: this.addflag,
          },
        ],
        [
          {
            type: "input",
            label: this.$t("config.contract", { no: "#1" }),
            props: "contact1",
            disabled: this.addflag,
          },
          {
            type: "input",
            label: this.$t("config.contractPhone", { no: "1" }),
            props: "phone1",
            disabled: this.addflag,
          },
          {
            type: "input",
            label: this.$t("config.contractFax", { no: "1" }),
            props: "fax1",
            disabled: this.addflag,
          },
          {
            type: "input",
            label: this.$t("config.contractFax", { no: "1" }),
            props: "email1",
            disabled: this.addflag,
          },
        ],
        [
          {
            type: "input",
            label: this.$t("config.contract", { no: "#2" }),
            props: "contact2",
            disabled: this.addflag,
          },
          {
            type: "input",
            label: this.$t("config.contractPhone", { no: "2" }),
            props: "phone2",
            disabled: this.addflag,
          },
          {
            type: "input",
            label: this.$t("config.contractFax", { no: "2" }),
            props: "fax2",
            disabled: this.addflag,
          },
          {
            type: "input",
            label: this.$t("config.contractFax", { no: "2" }),
            props: "email2",
            disabled: this.addflag,
          },
        ],
      ];
    },
  },
  methods: {},
  mounted() {
    if (this.$store.state.wms.toUpperCase().includes("WMWHSE")) {
      this.addflag = true;
    }
  },
  components: {
    "v-detail": detail,
  },
};
</script>

<style scoped></style>
